package com.oracle.oa.entity;

import java.sql.Timestamp;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;


@Entity                        
@Table(name="file_info")
public class Fileinfo  implements java.io.Serializable {
	 private static final long serialVersionUID = 1L;
	 @GenericGenerator(name = "generator", strategy = "increment")
	 @Id
	 @GeneratedValue(generator = "generator")
	 @Column(name = "fileid", unique = true, nullable = false)
     private int fileid;
	 
	 @ManyToOne
 	 @JoinColumn(name = "userinfo_id")
     private Userinfo userinfo;
	 
	 @ManyToOne
 	 @JoinColumn(name = "filetypeinfo_id")
     private Filetypeinfo filetypeinfo;
	 
	 @Column(name = "filename")
     private String filename;
	 
	 @Column(name = "remark")
     private String remark;
	 
	 @Column(name = "createdate")
     private Date createdate;
	 
	 @Column(name = "parentid")
     private int parentid;
	 
	 @Column(name = "filepath")
     private String filepath;
	 
	 @Column(name = "ifdelete")
     private int ifdelete;
	 
	 @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
     private Set accessoryfiles = new HashSet(0);
	
	 
	 public int getFileid() {
		return fileid;
	}
	public void setFileid(int fileid) {
		this.fileid = fileid;
	}
	public Userinfo getUserinfo() {
		return userinfo;
	}
	public void setUserinfo(Userinfo userinfo) {
		this.userinfo = userinfo;
	}
	public Filetypeinfo getFiletypeinfo() {
		return filetypeinfo;
	}
	public void setFiletypeinfo(Filetypeinfo filetypeinfo) {
		this.filetypeinfo = filetypeinfo;
	}
	public String getFilename() {
		return filename;
	}
	public void setFilename(String filename) {
		this.filename = filename;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Date getCreatedate() {
		return createdate;
	}
	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}
	public int getParentid() {
		return parentid;
	}
	public void setParentid(int parentid) {
		this.parentid = parentid;
	}
	public String getFilepath() {
		return filepath;
	}
	public void setFilepath(String filepath) {
		this.filepath = filepath;
	}
	public int getIfdelete() {
		return ifdelete;
	}
	public void setIfdelete(int ifdelete) {
		this.ifdelete = ifdelete;
	}
	public Set getAccessoryfiles() {
		return accessoryfiles;
	}
	public void setAccessoryfiles(Set accessoryfiles) {
		this.accessoryfiles = accessoryfiles;
	}
	public Fileinfo(int fileid, Userinfo userinfo, Filetypeinfo filetypeinfo,
			String filename, String remark, Date createdate, int parentid,
			String filepath, int ifdelete, Set accessoryfiles) {
		this.fileid = fileid;
		this.userinfo = userinfo;
		this.filetypeinfo = filetypeinfo;
		this.filename = filename;
		this.remark = remark;
		this.createdate = createdate;
		this.parentid = parentid;
		this.filepath = filepath;
		this.ifdelete = ifdelete;
		this.accessoryfiles = accessoryfiles;
	}
	public Fileinfo() {
		super();
		// TODO Auto-generated constructor stub
	}




}